﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>条件运算符</title>
</head>
<body>
    <script language="JavaScript" type="text/javaScript">
        let x = 23;
        let y = x < 10 ? x : -x;
        document.write("当前变量为：x=" + x + "<br>");
        document.write("执行语句（y = x < 10 ? x : -x）后，结果为：y=" + y);
    </script>
</body>
</html>